import React, { Component } from 'react'
import { Input } from 'antd'


interface IProps {
    getFile: (value: File, cateID: number) => void
    cateID: number
}
export default class FiletoFill extends Component<IProps> {

    //处理事件
    handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
        e.preventDefault()
        if (!!e.target.files)
            this.props.getFile(e.target.files[0], this.props.cateID)
    };
    render() {
        return (
            <Input style={{ width: 400 }} accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" type="file" onChange={this.handleChange} />
        )
    }
}
